package it.jx.wormholes.physics;
/**
 * A propulsion force that lasts for a fixed amount of time
 * 
 * @author Lorenzo Porzi
 * 
 */
public class Propulsion extends LocalForce {
	private double duration; // The duration of this force
	private Point3D strength; // The strength of this force

	/**
	 * Builds a Propulsion from its parameters.
	 * 
	 * @param strength
	 *            The strength of this force
	 * @param duration
	 *            The duration of this force
	 */
	public Propulsion(Point3D strength, double duration) {
		this.duration = duration;
		this.strength = strength;
	}

	@Override
	public Point3D value() {
		return strength;
	}

	@Override
	public boolean update(double dt) {
		duration -= dt;

		if (duration <= 0.0)
			return false;
		else
			return true;
	}
}
